package edu.iss.demo.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import edu.iss.demo.model.LeaveApplication;
import edu.iss.demo.repository.LeaveApplicationRepository;

@Service
public class LeaveApplicationServiceImpl implements LeaveApplicationService {

	@Resource
	private LeaveApplicationRepository leaveAppRep;
	
	@Override
	@Transactional
	public LeaveApplication create(LeaveApplication la) {
		// TODO Auto-generated method stub
		LeaveApplication createdLeaveApp = la;
		return leaveAppRep.save(createdLeaveApp);
	}

	@Override
	@Transactional
	public List<LeaveApplication> findAll() {
		// TODO Auto-generated method stub
		return leaveAppRep.findAll();
		
	}

}
